package com.idempotent.starter.controller;
import com.idempotent.starter.token.TokenService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/")
public class IndexController {
	private static final Logger logger = LoggerFactory
			.getLogger(IndexController.class);
	@Resource
	private TokenService tokenManager;

	@RequestMapping("/token")
	@ResponseBody
	public String token() {
		logger.debug("-------------token------------");
		return tokenManager.getToken();
	}
}
